All Functions Used So Far, Week 7

filter

{dplyr}

Filter out rows of a data frame according to logical vector

slice

{dplyr}

Subset rows using their positions

arrange

{dplyr}

Sort values of data frame according to a variable/combination of varaibles

ungroup

{dplyr}

Resolve grouping created with “group_by”

subset

{base}

Return subsets of vectors, matrices or data frames which meet conditions.

names

{base}

Retrieve names of a list/vector

var

{stats}

Calculate variance

summarise

{dplyr}

collapse the dataset to a summary statistic. Usually used with group_by()

length

{base}

Returns number of elements in an object

nrow

{base}

Get number of rows of a data frame

labs

{GGPLOT2}

Customise labels in GGPLOT2

expression

{base}

Used in plots to add symbols to axes

table

{base}

Obtain frequency table of a variable/cross-tabulation of two variables

element_line

{GGPLOT2}

Customise line appearance

setwd

{base}

Set Working Directory

par

{graphics}

Set parameters of the plotting device

with

{base}

evaluate expression in the context of a data frame

sum

{base}

Get sum of numeric values or a vector

theme

{GGPLOT2}

Set theme for GGPLOT2

range

{base}

Return range of values

recode

{dplyr}

Recode a variable

which.max

{base}

return index of the largest value in a vector

rm

{base}

Remove objects

c

{base}

Combine values/vectors into a vector

ls

{base}

Return a vector of character strings giving the names of the objects in the specified environment

mean

{base}

Get mean of a vector

mutate

{dplyr}

Modify/create a column in a data frame

group_by

{dplyr}

Group tibble/data.frame by a factor variable. All further tidyverse operations are performed group-wise

ifelse

{base}

Return a or b depending on the value of test

min

{base}

Get minimum of a vector

hist

{graphics}

Plot a simple histogram

aes

{GGPLOT2}

Construct aesthetic mapping of a ggplot graph

geom_segment

{GGPLOT2}

Generates a line segment or curve

read_excel

{readxl}

Read an Excel file

View

{base}

View a data frame

element_text

{GGPLOT2}

Customise text in GGPLOT2

ggplot

{GGPLOT2}

Create a ggplot graph

geom_ribbon

{GGPLOT2}

Generates an area plot

factor

{base}

Create a factor

scale_x_continuous

{GGPLOT2}

Customise continuous x axis

seq

{base}

Create a sequence

head

{utils}

Show first 5 rows of a data frame

ordered

{dplyr}

Create an ordered factor

levels

{base}

Get levels of a factor

boxplot

{graphics}

Plot a simple box plot

select

{dplyr}

Select columns from a tibble/data frame

max

{base}

Get maximum of a vector

str

{utils}

Get the structure of an R object

scale_y_continuous

{GGPLOT2}

Customise continuous y axis

geom_density

{GGPLOT2}

Generates a density plot

sd

{stats}

Get standard deviation of a vector

quantile

{stats}

Obtain empirical quantiles of a vector

read.csv

{utils}

Read a csv file to data frame. Specify stringsAsFactors = FALSE to keep all string columns as characters

element_blank

{GGPLOT2}

This theme element draws nothing, and assigns no space

ggsave

{ggplot2}

Saves the last ggplot or a specified ggplot object to a file

print

{base}

Print object to the console

summary

{base}

Obtain summary statistics or detailed regression output

cut

{base}

Convert Numeric to Factor

dnorm

{stats}

Density distribution for the normal distribution

theme_classic

{GGPLOT2}

A minimalistic theme with no gridlines

data.frame

{base}

Create a data.frame from vectors

install.packages

{base}

Install R package

median

{stats}

Get median of a vector

desc

{dplyr}

Arrange in descending order

plot

{graphics}

Generic function from base R to produce a plot

geom_histogram

{GGPLOT2}

Generates a histogram

library

{base}

Load an R package

The end!